import java.util.*;
import java.math.*;

public class ClassifyTriangle 
{
  private final double side1;
  private final double side2;
  private final double side3;
  private final int DECIMALPLACE = 3;
  
  public ClassifyTriangle(double a, double b, double c) 
  {
    side1 = a;
    side2 = b;
    side3 = c;
  }
  
  private boolean isTriangle() 
  {
    boolean ret = (side1 <= 0) || (side2 <= 0) || (side3 <= 0) || (side1 >= side2 + side3) || (side2 >= side1 + side3) || (side3 >= side1 + side2);
    return !ret;
  }
  
  
  private boolean isEquilateral() 
  {
    boolean ret = (side1 == side2) && (side2 == side3);
    return ret;
  }
  
  private boolean isIsosceles() 
  {
    boolean ret = (side1 == side2) || (side2 == side3) || (side3 == side1);
    return ret;
  }
  
  public static double truncate(double roundMe, int decimalPlace) {
      BigDecimal roundedValue = new BigDecimal(roundMe);
      roundedValue = roundedValue.setScale(decimalPlace, BigDecimal.ROUND_HALF_UP);
      return roundedValue.doubleValue();
  }

  private boolean isRight()
  {
    boolean ret = false;
    if( truncate((Math.sqrt(side1*side1 + side2*side2)), DECIMALPLACE) == side3)
    {
      ret = true;
    }
    else if( truncate(Math.sqrt((side2*side2 + side3*side3)), DECIMALPLACE) == side1)
    {
      ret = true;
    }
    else if( truncate(Math.sqrt((side1*side1 + side3*side3)), DECIMALPLACE) == side2)
    {
      ret = true;
    }
    return ret;
  }
  
  public String classifyMe()
  {
    String ret = "Not a triangle";
    if(isTriangle())
    {
      if(isEquilateral())
      {
        ret = "Equilateral";
      }
      else if(isIsosceles())
      {
        ret = "Isosceles";
      }
      else
      {
        ret = "Scalene";
      }
      if(isRight())
      {
        ret += " and right triangle";
      }
    }
    return ret;
    
  }
  
  public static void main(String[] args)
  {
    Scanner in = new Scanner(System.in);
    double a, b, c;
    System.out.print("Enter 3 triandle sides.");
    a = in.nextDouble();
    b = in.nextDouble();
    c = in.nextDouble();
    
    ClassifyTriangle unknown = new  ClassifyTriangle(a, b, c);
    System.out.println("Your sides created: " + unknown.classifyMe());
  }
  
}
